package com.yourcompany.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ChargingOrderStatusEnum {
    
    UNPAID(0, "待支付"),
    CHARGING(1, "充电中"),
    COMPLETED(2, "已完成"),
    CANCELLED(3, "已取消"),
    PAID(4, "已支付"),
    REFUNDING(5, "退款中"),
    REFUNDED(6, "已退款");

    private final int code;
    private final String desc;

    public static ChargingOrderStatusEnum getByCode(int code) {
        for (ChargingOrderStatusEnum status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }
} 